-
add-media-from-urlAdd Media from URL
Add Media from URL
Fetches a remote file by URL and adds it to the WordPress media library. Requires upload_files; main site only.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url |
string | Yes | The remote file URL to fetch. | |
post_id |
integer | No | Optional post to attach the media to. | |
desc |
string | No | Optional attachment description. | |
task_id |
integer | No | Optional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it. |
|
claim_token |
string | No | Optional. The claim_token from claim-next-task for task_id. Required when task_id is given. |